
package com.intretech.umsin.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.intretech.umsin.system.entity.SysUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
* @version V1.0
* 用户信息:sys_user 对应数据访问接口.
* @InterfaceName: SysUserMapper
* @Description: 用户信息:sys_user 对应数据访问接口.
* @author: 李启联
* @date:   2022-8-6 14:37:22
* @Copyright: Copyright (c) 2022
*/

@Mapper
public interface SysUserMapper extends BaseMapper<SysUserEntity> {

    @Select("select u.*,d.name as dept_name  from sys_user u left join sys_dept d on u.dept_id = d.id  where u.enabled =1 and account = #{account}")
    SysUserEntity getUserByAccount(String account);

    @Select("select u.*,d.name as dept_name  from sys_user u left join sys_dept d on u.dept_id = d.id  where u.enabled =1 and phone = #{phone}")
    SysUserEntity getUserByPhone(String phone);



}

